package com.appsindy.common.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 *
 * @author LEE
 */
public class AppCtxHolder implements ApplicationContextAware {

    private static ApplicationContext ctx;

    public AppCtxHolder() {}

    public void setApplicationContext(ApplicationContext applicationContext) {
        ctx = applicationContext;
    }

    public static ApplicationContext getApplicationContext() {
        if(ctx == null){
            ctx = AppCtxHolder.getApplicationContext();
        }
        return ctx;
    }
}
